package hng.mapper;

import hng.model.NavDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import hng.vo.admin.NavVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 导航栏 Mapper 接口
 * </p>
 *
 * @author 告白
 * @since 2024-06-27
 */
public interface NavMapper extends BaseMapper<NavDO> {

    /**
     * 分页查询导航栏列表
     */
    @Select("select n.*, c.name as categoryName from nav n " +
            "left join product_category c on n.category_id = c.id " +
            "order by n.weight asc")
    List<NavVO> navList();
}
